package com.devo.icecream.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.devo.icecream.AppLogger
import com.devo.icecream.service.ActivityWatcherService

class BootCompletedReceiver : BroadcastReceiver() {
    override fun onReceive(ctx: Context?, intent: Intent?) {
        //开机启动广播
        intent?.takeIf { it.action == Intent.ACTION_BOOT_COMPLETED }?.let {
            // TODO: 2022/8/1 启动监控Service
            ctx?.let {
                AppLogger.i("启动远程 watch 服务")
                it.startService(Intent(it, ActivityWatcherService::class.java))
            }
        }
    }
}